#include <bits/stdc++.h>

using namespace std;

string s1;
char stk[500010];
int top = 0,n;
int main (){
	cin >>n;
	cin >> s1;
	for(int i = 0;i < n;i++){
		stk[++top] = s1[i];
		if(top >= 3 && stk[top] == 'x' && stk[top-1] == 'o' && stk[top-2] == 'f') top-=3;
	}
	printf("%d\n",top);
	return 0;
}
